package com.ruoyi.gxdj.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.gxdj.mapper.InfoVideoMapper;
import com.ruoyi.gxdj.domain.InfoVideo;
import com.ruoyi.gxdj.service.IInfoVideoService;

/**
 * 视频Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-03-16
 */
@Service
public class InfoVideoServiceImpl implements IInfoVideoService 
{
    @Autowired
    private InfoVideoMapper infoVideoMapper;

    /**
     * 查询视频
     * 
     * @param id 视频主键
     * @return 视频
     */
    @Override
    public InfoVideo selectInfoVideoById(Long id)
    {
        return infoVideoMapper.selectInfoVideoById(id);
    }

    /**
     * 查询视频列表
     * 
     * @param infoVideo 视频
     * @return 视频
     */
    @Override
    public List<InfoVideo> selectInfoVideoList(InfoVideo infoVideo)
    {
        return infoVideoMapper.selectInfoVideoList(infoVideo);
    }

    /**
     * 新增视频
     * 
     * @param infoVideo 视频
     * @return 结果
     */
    @Override
    public int insertInfoVideo(InfoVideo infoVideo)
    {
        infoVideo.setCreateTime(DateUtils.getNowDate());
        infoVideo.setUserId(SecurityUtils.getUserId());
        return infoVideoMapper.insertInfoVideo(infoVideo);
    }

    /**
     * 修改视频
     * 
     * @param infoVideo 视频
     * @return 结果
     */
    @Override
    public int updateInfoVideo(InfoVideo infoVideo)
    {
        return infoVideoMapper.updateInfoVideo(infoVideo);
    }

    /**
     * 批量删除视频
     * 
     * @param ids 需要删除的视频主键
     * @return 结果
     */
    @Override
    public int deleteInfoVideoByIds(Long[] ids)
    {
        return infoVideoMapper.deleteInfoVideoByIds(ids);
    }

    /**
     * 删除视频信息
     * 
     * @param id 视频主键
     * @return 结果
     */
    @Override
    public int deleteInfoVideoById(Long id)
    {
        return infoVideoMapper.deleteInfoVideoById(id);
    }
}
